package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.service.BtoLeaseReviewService;
import com.bto.solar.work.service.BtoOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 越秀-审核表 前端控制器
 * </p>
 *
 * @author adrian
 * @since 2023-08-09
 */
@RestController
@RequestMapping("/lease-review")
public class LeaseReviewController {

    @Autowired
    private BtoLeaseReviewService btoLeaseReviewService;
    @Autowired
    private BtoOrderService btoOrderService;

    /**
    * 获取越秀签约链接
    */
    @GetMapping("/get-sign-url")
    public R<String> getSignUrl(@RequestParam String orderId){
        return R.ok(btoLeaseReviewService.getSignUrlByOrderId(orderId));
    }

    /**
    * 同步进件
    */
    @GetMapping("/sync/project")
    public R syncProject(@RequestParam String orderId){
        btoOrderService.pushSyncProjectLeasePreApproval(orderId);
        return R.ok();
    }





}
